package thinking.enumerated;

import java.util.EnumSet;
import static thinking.enumerated.AlarmPoints.*;
import static thinking.net.mindview.util.Print.*;

/**
 * 演示了EnumSet
 */
public class EnumSets {
    public static void main(String[] args) {
        EnumSet<AlarmPoints> points = EnumSet.noneOf(AlarmPoints.class);  // empty
        points.add(BATHROOM);
        print(points);
        points.addAll(EnumSet.of(STARI1, STAIR2, KITCHEN));
        print(points);
        points = EnumSet.allOf(AlarmPoints.class);
        points.removeAll(EnumSet.range(OFFICE1, OFFICE4));
        print(points);
        points = EnumSet.complementOf(points);
        print(points);
    }
}
